package com.epam.necklace.view.menu.mainmenu;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.epam.necklace.logic.activity.Necklace;
import com.epam.necklace.view.menu.*;
import com.epam.necklace.view.menu.mainmenu.submenu.*;

public class CreateNecklace extends MenuItem {
	private static final Logger log = Logger.getLogger(CreateNecklace.class);
	private final Menu subMenu;
	private static final List<MenuItem> items;

	static {
		items = new ArrayList<MenuItem>();
		items.add(new Gems());
		items.add(new Stones());
		items.add(new MainMenu());
	}

	public CreateNecklace() {
		super("Create necklace", "1");
		subMenu = new Menu(items);
	}

	@Override
	public boolean execute() {
		log.info("Create comand");
		Necklace.necklace.clear();
		subMenu.run();
		return true;
	}

}
